package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * 信息日志实体类
 *
 * @author yourname
 */
public class InfoLog extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 车牌号 */
    @Xss(message = "车牌号不能包含脚本字符")
    private String vehiclePlate;

    /** 操作类型：1=进场，2=出场，3=支付 */
    private Integer actionType;

    /** 记录的JSON数据 */
    private String jsonData;

    /** 操作时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actionTime;

    /** 处理时间（秒） */
    private Double processingTime;

    /** HTTP状态码 */
    private Integer httpStatusCode;

    /** 操作是否成功 */
    private Boolean success;

    /** 错误信息（如果有） */
    private String errorMessage;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getVehiclePlate() {
        return vehiclePlate;
    }

    public void setVehiclePlate(String vehiclePlate) {
        this.vehiclePlate = vehiclePlate;
    }

    public Integer getActionType() {
        return actionType;
    }

    public void setActionType(Integer actionType) {
        this.actionType = actionType;
    }

    public String getJsonData() {
        return jsonData;
    }

    public void setJsonData(String jsonData) {
        this.jsonData = jsonData;
    }

    public Date getActionTime() {
        return actionTime;
    }

    public void setActionTime(Date actionTime) {
        this.actionTime = actionTime;
    }

    public Double getProcessingTime() {
        return processingTime;
    }

    public void setProcessingTime(Double processingTime) {
        this.processingTime = processingTime;
    }

    public Integer getHttpStatusCode() {
        return httpStatusCode;
    }

    public void setHttpStatusCode(Integer httpStatusCode) {
        this.httpStatusCode = httpStatusCode;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }


    /** 请求IP地址 */
    private String ipAddress;




    public InfoLog() {}

    public InfoLog(Long id) {
        this.id = id;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /** 创建时间 */
    private Date createTime;



    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("vehiclePlate", getVehiclePlate())
                .append("actionType", getActionType())
                .append("jsonData", getJsonData())
                .append("actionTime", getActionTime())
                .append("processingTime", getProcessingTime())
                .append("httpStatusCode", getHttpStatusCode())
                .append("success", getSuccess())
                .append("errorMessage", getErrorMessage())
                .append("ipAddress", getIpAddress())
                .append("createTime", getCreateTime())
                .toString();
    }
}
